/*-----------------------------------------
file name  : fxp_mul.v
created    : 2025/04/26 23:05:39
modified   : 2025-04-26 23:08:17
description: multiplication 
notes      : 
author     : yyrwkk
-----------------------------------------*/
module fxp_mul # (
    parameter WIIA = 8    ,
    parameter WIFA = 8    ,
    parameter WIIB = 8    ,
    parameter WIFB = 8    ,
    parameter WOI  = 8    ,
    parameter WOF  = 8    ,
    parameter ROUND= 1    
)(
    input  [WIIA+WIFA-1:0] ina     ,
    input  [WIIB+WIFB-1:0] inb     ,
    output [WOI +WOF -1:0] out     ,
    output                 overflow
);

localparam WRI = WIIA + WIIB;
localparam WRF = WIFA + WIFB;

wire [WRI+WRF-1:0] res;
assign res = $signed(ina) * $signed(inb);

fxp_zoom # (
    .WII      ( WRI            ),
    .WIF      ( WRF            ),
    .WOI      ( WOI            ),
    .WOF      ( WOF            ),
    .ROUND    ( ROUND          )
) res_zoom (
    .in       ( res            ),
    .out      ( out            ),
    .overflow ( overflow       )
);

endmodule
